<!DOCTYPE html>
<html>
<head>
    <title>任务管理</title>
    <meta charset="UTF-8">
    <!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../public/css/bootstrap.min.css">
    <link rel="stylesheet" href="../public/css/font-awesome.min.css">
    <link rel="stylesheet" href="../public/plugins/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="../public/plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../public/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../public/css/main.css">

</head>
<body>


<div id="teacherSelectCourse" v-cloak><!--列表信息加toolbar-->
    <!--selectedCoursesTable表-->
    <div v-show="showList==1">
        <div id="toolbar">
            <button class="btn btn-success " type="button" @click="add">
                <i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">添加</span>
            </button>

            <button class="btn btn-danger " type="button" @click="del">
                <i class="fa fa-remove"></i>&nbsp;&nbsp;<span class="bold">删除</span>
            </button>

            <button class="btn btn-default " type="button" @click="roleManage">
                <i class="fa fa-pencil-square-o"></i>&nbsp;&nbsp;<span class="bold">角色管理</span>
            </button>

            <button v-show="hasPermission('sys:menu:delete')" class="btn btn-info " type="button">
                <i class="fa fa-desktop"></i>&nbsp;&nbsp;<span class="bold">分配</span>
            </button>
            <button v-show="hasPermission('sys:menu:delete')" class="btn btn-info " type="button">
                <i class="fa fa-desktop"></i>&nbsp;&nbsp;<span class="bold">查看</span>
            </button>
        </div>
        <table id="selectedCoursesTable"></table>
    </div>
    <!--选课弹窗-->
    <div class="modal fade" id="selectCourseDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="createModalTitle">
                        添加用户信息
                    </h4>
                </div>
                <div class="modal-body">
                    <div id="userCue" class="cue">注册请注意格式</div>
                    <form>
                        <!--<div class="form-group">-->
                        <!--<label for="courseName">用户编号</label>-->
                        <!--<select  v-model="user.user_info_id" class="form-control" id="user_info_id" name="courseName" placeholder="className"></select>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label for="userid">用户账号</label>
                            <input v-model="user.userid" id="userid" type="text" class="form-control" name="userid"
                                   placeholder="userid"/>
                        </div>
                        <div class="form-group">
                            <label for="password">用户密码</label>
                            <input v-model="user.password" id="password" type="text" class="form-control" name="userid"
                                   placeholder="userid"/>
                        </div>
                        <div class="form-group">
                            <label for="name">用户姓名</label>
                            <input v-model="user.name" id="name" class="form-control" name="courseName"
                                   placeholder="name"/>
                        </div>
                        <div class="form-group">
                            <label for="githubURL">性别</label>
                            <select v-model="user.githubURL" id="githubURL" class="form-control" name="courseName">
                                <!--placeholder="性别">-->
                                <option value="1" selected>男</option>
                                <option value="0">女</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="email">邮箱</label>
                            <input v-model="user.email" id="email" class="form-control" name="courseName"
                                   placeholder="email"/>
                        </div>

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" @click="submit">
                        添加
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

    <!--roles表-->
    <div v-show="showList==2">
        <div id="toolbar2">
            <button class="btn btn-success " type="button" @click="backToCourse">
                <i class="fa fa-desktop"></i>&nbsp;&nbsp;<span class="bold">返回用户</span>
            </button>
            <!--@click="addRole"-->
            <button class="btn btn-success " type="button" @click="addRole">
                <i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">分配</span>
            </button>
            <!--@click="delRole"-->
            <button class="btn btn-danger " type="button" @click="delRole">
                <i class="fa fa-remove"></i>&nbsp;&nbsp;<span class="bold">删除</span>
            </button>
            <!--@click="pageManage"-->
            <button class="btn btn-default " type="button" @click="pageManage">
                <i class="fa fa-pencil-square-o"></i>&nbsp;&nbsp;<span class="bold">页面管理</span>
            </button>
        </div>
        <table id="testManageTable"></table>
    </div>
    <!--pages表-->
    <div v-show="showList==3">
    <div id="toolbar3">
    <button class="btn btn-success " type="button" @click="backToCourse">
    <i class="fa fa-desktop"></i>&nbsp;&nbsp;<span class="bold">返回用户</span>
    </button>

    <button class="btn btn-success " type="button" @click="backToRole">
    <i class="fa fa-desktop"></i>&nbsp;&nbsp;<span class="bold">返回角色</span>
    </button>
    <button class="btn btn-success " type="button" @click="addPage">
    <i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">新增</span>
    </button>

    <button class="btn btn-danger " type="button" @click="delPage">
    <i class="fa fa-remove"></i>&nbsp;&nbsp;<span class="bold">删除</span>
    </button>

    </div>
    <table id="pageManageTable"></table>
    </div>

    <!--新增实验弹窗-->
    <div class="modal fade" id="addTestDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="addTestTitle">
                        添加角色
                    </h4>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                            <label for="testName">角色名称</label>
                            <select v-model="roles.rolename"  class="form-control" id="testName"
                                    name="testName">
                            </select>

                        </div>

                        <!--<div class="form-group">-->
                            <!--<label for="desc">角色描述</label>-->
                            <!--<textarea v-model="roles.roledetail" rows="8" type="text" class="form-control" id="desc"-->
                                      <!--name="desc" placeholder="roleDetail"></textarea>-->
                        <!--</div>-->

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" @click="submitAddTest">
                        添加
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!--新增页面弹窗-->
    <div class="modal fade" id="addPageDialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="addPageTitle">
                        添加页面
                    </h4>
                </div>
                <div class="modal-body">
                    <form>
                        <div class="form-group">
                        <label for="pageName">页面名称</label>
                        <select v-model="pages.pagename"  class="form-control" id="pageName"
                                name="pageName">
                        </select>

                    </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary" @click="submitAddPage">
                        添加
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>

<script src="../public/libs/jquery.min.js"></script>
<script src="../public/plugins/layer/layer.js"></script>
<!--<script src="../public/js/UserManager/login/jquery-1.9.0.min.js"></script>-->
<script src="../public/libs/bootstrap.min.js"></script>
<script src="../public/libs/vue.min.js"></script>
<script src="../public/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="../public/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="../public/plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../public/js/common.js"></script>


<script src="../public/plugins/layui/layui.js"></script>
<script src="../public/js/UserManager/allUsers.js"></script>
<script>
    $(document).ready(function () {

        $("#userid").blur(function () {
            //获取输入的值，发送到服务器中做查询aa
            var userid = $(this).val();
            if (userid == null || userid === "") {
                $('#userCue').html("<font color='red'><b>×用户名不能为空</b></font>");
            }
            userid={"userid":userid};
            console.log(userid);
            $.ajax({
                url: "/sys/do_checkAddUser",
                data: JSON.stringify(userid),
                type: "post",
                success: function (result) {
                    //数据解析
                    // alert(result);
                    if (result) {
                        $("#userCue").html("<b style='color:red'>x用户名已被注册</b>");

                    } else {
                        $("#userCue").html("<font color='red'><b>用户名可用</b></font>");
                    }
                }
            });
        });

    });

</script>

</body>
</html>